<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="com.java.service.*,java.util.*,com.java.model.UserSession,com.java.util.*"%>
<jsp:include page="common/header.jsp"></jsp:include>
<%
	UserSession usersession = (UserSession)session.getAttribute("user");
	String ent_id 			= (String)session.getAttribute("ent_id");
	
	String connGroup 	= "";
	String user_id 		= "";
	if(usersession!=null){
		connGroup 	= CmmUtil.nvl(usersession.getConnGroup(),"0");
		user_id 	= CmmUtil.nvl(usersession.getUser_id(),"");
	}
	String search_gb 	= CmmUtil.nvl(request.getParameter("search_gb"),"");
	String search_word 	= CmmUtil.nvl(request.getParameter("search_word"),"");
	String line_number	= CmmUtil.nvl(request.getParameter("line_number"),"10");
	String total_count 	= CmmUtil.nvl(request.getParameter("total_count"),"");
	String curr_page 	= CmmUtil.nvl(request.getParameter("curr_page"),"");
	
	
 	String blt_cont_no = CmmUtil.nvl(request.getParameter("blt_cont_no"),"0");

 	
 	//내용
	String id 			="";
	String title 		="";
	String write_name 	="";
	String write_dt		="";
	String read_cnt 	="";
	String rownum		="";
	String r_num		="";

	if (!blt_cont_no.equals("0")){ 	
		HashMap map = new HashMap();
		HashMap map1 = null;
		ArrayList list = new ArrayList();
		CommonDaoService commonservice = new CommonDaoService("Com0401lp02Dao");
	
		map.put("blt_cont_no",blt_cont_no);

		
		list = (ArrayList)commonservice.commonDaoMethod(map);
	}


	
%>
<script type="text/javascript">
  _editor_url = "/js/htmlediter/";
  _editor_lang = "en";
</script>
<script type="text/javascript" src="/js/ckeditor/ckeditor.js"></script>

<script>

function go_list(){
	var frm = document.mainfrm;
	frm.action = "/jsp/com0401l_p01.jsp";	
	frm.method = "post";
	frm.submit();	
}
function checkkeycode(event){
	if ( event.keyCode == 13 ) {
		search();
	} 
}
function _onsubmit(){
	var fr = document.mainfrm;
	if (fr.title.value == ""){
		alert("제목을 입력하세요");
		fr.title.focus();
		return;
	}else if (fr.content.value == ""){
		alert("내용을 입력하세요");
		fr.content.focus();
		return;
	}
	fr.action = "/jsp/com0401l_02_update.jsp";
	fr.target = "hide_src";
	fr.submit();
}
</script>
<link href="/js/ckeditor/sample.css" rel="stylesheet" type="text/css" />
<body>
<form name="mainfrm" method="post">

<input type="hidden" name="search_gb" value="<%=search_gb%>">
<input type="hidden" name="search_word" value="<%=search_word%>">
<input type="hidden" name="curr_page" value="<%=curr_page%>">
<input type="hidden" name="total_count" value="<%=total_count%>">
<input type="hidden" name="blt_cont_no" value="<%=blt_cont_no%>">
<input type="hidden" name="ent_id" value="<%=ent_id %>">
<input type="hidden" name="line_number" value="<%=line_number %>">

<table width="992" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td><!--top -->
    <jsp:include page="common/top_menu.jsp"></jsp:include> 
    <!-- //top -->
    <!-- contents area -->
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="180" valign="top">
    	<jsp:include page="left/com0401l_left.jsp"></jsp:include> 
    </td>
    <td width="21" valign="top">&nbsp;</td>
    <td valign="top">
    	 <table width="790px"  border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td style="font-size:14px; color:#3b70a2; font-weight:bold; border-bottom:2px solid #c8c8c8; padding:0 0 5px 0;" align="left"><img src="/images/sub_icon1.jpg"  alt="" border="0">&nbsp;공지사항</td>
             </tr>
        </table>
		<table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin:5px 0 10px 0;">
        	<tr>
            	<td align="center" width="100px" style="font-weight:bold;font-size:13px;">제목 : </td>
                <td align="left" width="690px"> <input type="text" size="80" name="title" required="required" hname="제목" /></td>
            </tr>
            <tr>
              <td colspan="2" style="padding:5px 0 5px 0;" align="left"><img src="/images/line_member.gif"  alt="" border="0"></td>
            </tr>
            <tr>
            	<td colspan="2" align="left" style="color:#CCCCCC; ">
					<textarea id="content" class="ckeditor" name="content" style="width:100%" rows="60" cols="80"></textarea>
				</td>
            </tr>
           <tr>
              <td colspan="4" style="padding:5px 0 5px 0;" align="left"><img src="/images/line_member.gif"  alt="" border="0"></td>
            </tr>
        	<tr>
            	<td align="center" width="100px" style="font-weight:bold;font-size:13px;">첨부파일 : </td>
                <td align="left" width="690px"> <input type="file" size="80" name="addfile" required="required" hname="첨부파일" /></td>
            </tr>
<%	if (blt_cont_no.equals("0")){ %>
            <tr>
				<td align="left" style=""><input name="button2" type="button" class="btn_gray_s_w47" onclick="javascript:go_list();" value="목 록" /></td>
            	<td align="right" style=""><input name="button2" type="button" class="btn_blue_s_w90" onclick="javascript:_onsubmit();" value="등  록" /></td>
            </tr>
<%}else{ %>
            <tr>
				<td align="left" style=""><input name="button2" type="button" class="btn_gray_s_w47" onclick="javascript:go_list();" value="목 록" /></td>
            	<td align="right" colspan="4" style=""><input name="button2" type="button" class="btn_blue_s_w90" onclick="javascript:_onsubmit();" value="수 정" /></td>
            </tr>
<%} %>                   
        </table>
    </td>
    </tr>
	</table>
   
    <jsp:include page="common/footer.jsp"></jsp:include>
        </tr>
    </table>
	</td>
  </tr>
</table>
<iframe name='hide_src'  width='0' height='0' SCROLLING='AUTO' frameborder='0'></iframe>
</form>
</body>
</html>
